# 项目:
# 文件: testqb
# 作者: Yang
# 日期: 2025/5/21 17:39
# coding:utf-8


from time import sleep
import os

from pytestdemo.action.acaction import Question_bank_management
from pytestdemo.tools import Util,UIAction



class TestQuestion_bank_management:

    # 前置步骤
    @classmethod
    def setup_class(cls):
        cls.driver = UIAction.get_driver()
        UIAction.do_login()
        login_url = Util.read_json('../data/conf.json')['login_url']
        cls.driver.get(login_url)
        sleep(2)
        cls.add_single_choice = Util.get_info('add_single_choice')

    #测试添加单选

    def test_add_choice(self):
        for info in self.add_single_choice:
            actual = Question_bank_management.do_single_choice(self.driver, info['data'])
            assert actual == info['expect']

